<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
    <div class="t_bar">项目基本情况</div>
    <input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
    <input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
    <input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
    <input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
	<table class="t_css" width="100%" id="table_01">
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	    <tr >
	        <td align="right"><span class="color_red">*</span>院士工作站名称：</td>
	        <td colspan="3">
	        	<input type='text' name='proposal/zh_title' id='zh_title' style="width: 89.5%" class="input_css required " maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="院士工作站名称">
	        </td>
	    </tr>
	    <tr>
	        <td align="right"><span class="color_red">*</span>归口管理部门：</td>
	        <td>
	        	<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
				<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理部门"
         			id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt1" />
				<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
				<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
 			</td>
 			<td align="right">上年实现利税（万元） ：</td>
 			<td>
 			    <input type='text' name='proposal/lyear_tax' class="" onfocus="InitInput.setNumber(this,9,2,2,'',true)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_tax"/>' label="上年实现利税">
 			</td>
	    </tr>

        <tr>
            <td align="right" ><span class="color_red">*</span>申报日期：</td>
            <td colspan="3">
                <c:set var="submit_date">
                    <x:out select="$xmlData/data/proposal/submit_date" />
                </c:set>
                <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
            </td>
        </tr>
	    <tr>
	        <td align="right"><span class="color_red">*</span>单位性质：</td>
	        <td align="center" colspan="3">
	            <c:set var="unit_nature"><x:out select="$xmlData/data/proposal/unit_nature" /></c:set>
                <cpt:checkbox key="unit_nature3" name="proposal/unit_nature"  value="${unit_nature }" width="30px;" tagType="radio" repeatColumn="4"  style="border: 0px; padding: 0px; margin: 0px;float:left;"  ></cpt:checkbox>
                <input type="hidden" id="unit_nature_value" name="proposal/unit_nature_value"  class="required"  value="<x:out select="$xmlData/data/proposal/unit_nature_value" />" label="单位性质">
                <input type="hidden" name="proposal/unit_nature_name" value="<x:out select="$xmlData/data/proposal/unit_nature_name" />">
	        </td>
	    </tr>
		<tr>
			<td align="right">注册时间：</td>
			<td>
				<span name="proposal/registe_date"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_date"/></span>
			</td>
			<td align="right">注册资本：</td>
			<td>
                <span name="proposal/registe_fund">
                    <x:out select="$xmlData/data/org_basic_info/registe_fund"/>万
                    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_fund_money_name"/>
                </span>
			</td>
		</tr>
	    <tr >
	    	<td align="right"><span class="color_red">*</span>经办人姓名：</td>
	    	<td>
	    		<input type="text"  maxlength="30" name="proposal/contact_psn_cname" class="required"  label="经办人姓名" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
	    	</td>
	    	<td align="right"><span class="color_red">*</span>经办人手机：</td>
	    	<td>
	    		<input type="text"  name="proposal/contact_psn_mobile" class="required mobile" maxlength="11" label="经办人手机" onfocus="InitInput.setNumber(this,11,0,0);" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
	    	</td>
	    </tr>
	    <tr >
	    	<td align="right"><span class="color_red">*</span>经办人电话：</td>
	    	<td>
	    		<input type="text"  maxlength="20" name="proposal/contact_tel" class="required" label="经办人电话" value="<x:out select="$xmlData/data/proposal/contact_tel" />">
	    	</td>
	    	<td align="right"><span class="color_red">*</span>经办人邮箱：</td>
	    	<td>
	    		<input type="text"  maxlength="50" name="proposal/contact_email" class="required email" label="经办人邮箱" value="<x:out select="$xmlData/data/proposal/contact_email" />">
	    	</td>
	    </tr>
	    <tr >
	    	<td align="right"><span class="color_red">*</span>邮政编码：</td>
	    	<td>
	    		<input type="text"  maxlength="6" name="proposal/zip_code" class="required" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" label="邮政编码" value="<x:out select="$xmlData/data/proposal/zip_code" />">
	    	</td>
	    	<td align="right"><span class="color_red">*</span>传真：</td>
	    	<td>
	    		<input type="text"  maxlength="40" name="proposal/fax" class="required" label="传真" value="<x:out select="$xmlData/data/proposal/fax" />">
	    	</td>
	    </tr>
	    <tr >
	    	<td align="right"><span class="color_red">*</span>加盟院士姓名：</td>
	    	<td>
	    		<input type="text"  maxlength="30" name="proposal/academician_name" class="required" label="加盟院士姓名" value="<x:out select="$xmlData/data/proposal/academician_name" />">
	    	</td>
	    	<td align="right"><span class="color_red">*</span>院士管理机构 ：</td>
	    	<td>
	    	    <c:set var="academician_manage"><x:out select="$xmlData/data/proposal/academician_manage_value" /></c:set>
	            <cpt:select id="academician_manage" key="academician_manage"  className="input_css" name="academician_manage"
	            onChange="initControlValue(this.id);" value="${academician_manage }" style="width: 167.5px;border: 1px solid #A1C0DC;"></cpt:select>
	            <input type="hidden" name="proposal/academician_manage_value" value="${academician_manage }" class="input_text required" label="院士管理机构"/>
	            <input type="hidden" name="proposal/academician_manage_name" value="<x:out select="$xmlData/data/proposal/academician_manage_name" />" />
	    	</td>
	    </tr>
	    <tr >
	    	<td align="right"><span class="color_red">*</span>院士任职单位：</td>
	    	<td>
	    		<input type="text"  maxlength="60" name="proposal/academician_unit" class="required" label="院士任职单位" value="<x:out select="$xmlData/data/proposal/academician_unit" />">
	    	</td>
	    	<td align="right"><span class="color_red">*</span>组建日期：</td>
	    	<td>
	            <c:set var="build_date"><x:out select="$xmlData/data/proposal/build_date" /></c:set>
	            <cpt:date id="build_date" name="proposal/build_date" value="${build_date}" className="required date beforeToday" label="组建日期"></cpt:date>
	    	</td>
	    </tr>

		<tr >
			<td align="right"><span class="color_red">*</span>院士身份：</td>
			<td>
				<c:set var="identity"><x:out select="$xmlData/data/proposal/identity" /></c:set>
				<cpt:checkbox key="identity" name="proposal/identity"  value="${identity }" width="30px;" tagType="radio" repeatColumn="4"  style="border: 0px; padding: 0px; margin: 0px;float:left;"  ></cpt:checkbox>
				<input type="hidden" id="identity" name="proposal/identity_value"  class="required"  value="<x:out select="$xmlData/data/proposal/identity_value" />" label="院士身份">
				<input type="hidden" name="proposal/identity_name" value="<x:out select="$xmlData/data/proposal/identity_name" />">			</td>
			<td align="right"><span class="color_red">*</span>院士在全国已建站数量：</td>
			<td>
				<input type='text' name='proposal/number_stations' class="required" onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/number_stations"/>' label="院士在全国已建站数量">

			</td>
		</tr>
    </table>
    
    <div class="t_bar"><span class="color_red">*</span>单位人员状况</div>
    <table class="t_css" width="100%" id="table_02">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
        <tr>
            <td  align="right" colspan="2">职工总数：</td>
            <td colspan="2">
                <input type='text' name='proposal/worker_total_count' id="worker_total_count" class="required" onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/worker_total_count"/>' label="职工总数">
            </td>
        </tr>
        <tr>
            <td align="right" rowspan="4">研发人员：</td>
            <td align="right" >高级职称：</td>
            <td colspan="2">
                <input type='text' name='proposal/worker_level1_count' id="worker_level1_count" class="required" onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/worker_level1_count"/>' label="研发人员-->高级职称">
            </td>
        </tr>
        <tr>
            <td align="right" >中级职称：</td>
            <td colspan="2">
                <input type='text' name='proposal/worker_level2_count' id="worker_level2_count" class="required" onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/worker_level2_count"/>' label="研发人员--中级职称">
            </td>
        </tr>
        <tr>
            <td align="right" >其他：</td>
            <td colspan="2">
                <input type='text' name='proposal/worker_level3_count' id="worker_level3_count" class="required" onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/worker_level3_count"/>' label="研发人员--其他">
            </td>
        </tr>
        <tr>
            <td align="right" >合计：</td>
            <td colspan="2">
                <input type='text' name='proposal/worker_research_total' id="worker_research_total" class="gray" readonly="readonly" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/worker_research_total"/>' label="研发人员--合计">
            </td>
        </tr>
		<tr>
			<td align="right"><span class="color_red">*</span>项目简述（280字）：</td>
			<td colspan="3">
				<textarea rows="9" style="width: 98%" class="input_textarea required maxlength:280" maxlength="280" label="项目简述" name="proposal/pro_describe" ><x:out select="$xmlData/data/proposal/pro_describe"/></textarea>
				<input type="hidden" name="proposal/pro_describe_hidden" value="<x:out select="$xmlData/data/proposal/pro_describe_hidden"/>" />
			</td>
		</tr>
	</table>
	
	
<script type="text/javascript">

function initTreeValueExt1(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
 }
 //--------------------计算总数------------------begin
 $('#worker_level1_count,#worker_level2_count,#worker_level3_count').change(function(){
	 getTotalCount('worker_','level1_count,level2_count,level3_count','research_total');
 });
 //--------------------计算总数------------------end
/**
----------------------by zk
        参数prefix：公共的id开头
        参数count：需要加的数的id结尾     以,分割
        参数total：总数id结尾
        参数isDeciaml：是否为小数 默认为false
*/
function getTotalCount(prefix,count,total,isDecimal){
  var defaultIsDecimal = false;//默认为整数
  if(isDecimal==null){
        isDecimal = defaultIsDecimal;
  }
  var numStr = count.split(',');
  var totalCount = 0;//总数
  if(!isDecimal){
        for ( var int = 0; int < numStr.length; int++) {
             var num = $('#'+prefix+numStr[int]).val();
             if(!$.isNumeric(num))
                  num = "0";
             totalCount += parseInt(num);
       }
  }else {
     for ( var int = 0; int < numStr.length; int++) {
         var num = $('#'+prefix+numStr[int]).val();
         if(!$.isNumeric(num))
             num = "0";
         totalCount += parseFloat(num);
     }
     totalCount = ((totalCount/100)*100).toFixed(2);
  }
  $('#'+prefix+total).val(totalCount);
}


</script>	